﻿using System;
using ExplorerService.Common.DataContracts;
using ExplorerService.Common.ServiceContracts;
using ExplorerService.Managers;

namespace ExplorerService.Communication
{
    public class ApplicationSessionService : IApplicationSessionService
    {
        
        /// <summary>
        /// Registers a new application session based on the provided information
        /// </summary>
        /// <param name="information">The application information</param>
        /// <returns>The session token for the application. Guid.Empty if register failed</returns>
        public Guid GetApplicationSessionId(ApplicationInformation information)
        {
            return ApplicationSessionManager.Instance.GetNewApplicationSessionId(information);
        }

        /// <summary>
        /// Lets the service know that this session is still alive
        /// </summary>
        /// <param name="applicationSessionId">The session ID for the application</param>
        public bool Hearbeat(Guid applicationSessionId)
        {
            return ApplicationSessionManager.Instance.HeartBeart(applicationSessionId);
        }

        
    }
}
